
package com.plian.system.service.fr.authorize.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.plian.system.entity.fr.authorize.AuthorizeColumn;
import com.plian.system.mapper.fr.authorize.AuthorizeColumnMapper;
import com.plian.system.service.fr.authorize.IAuthorizeColumnService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * column和sheet关系表 服务实现类
 *
 * @author panqb
 * @since 2022-01-07
 */
@Service
@AllArgsConstructor
public class AuthorizeColumnServiceImpl extends ServiceImpl<AuthorizeColumnMapper, AuthorizeColumn> implements IAuthorizeColumnService {

    /**
     * logger属性.
     */
    private static final Logger LOGGER  = LoggerFactory.getLogger(AuthorizeColumnServiceImpl.class);


    @Override
    public String columnNumberToColumnId(int columnNumber, String sheetId) {
        AuthorizeColumn authorizeColumn = getOne(Wrappers.<AuthorizeColumn>lambdaQuery()
                .eq(AuthorizeColumn::getOrgId, sheetId).eq(AuthorizeColumn::getOrderNumber, columnNumber));
        if (authorizeColumn != null){
            return authorizeColumn.getColumnId();
        }
        return null;
    }
}
